package cn.medemede.k1;

public class Rectangle extends Shape {

    double x;
    double y;

    Rectangle() {
        name="矩形";
    }

    @Override
    public double area() {
        return x*y;
    }

    @Override
    public double perimeter() {
        return (x+y)*2;
    }

    @Override
    public String toString() {
        return "Rectangle{" +
                "x=" + x +
                ", y=" + y +
                ", name='" + name + '\'' +
                '}';
    }
}
